package com.jaay.vo;

import com.jaay.DeepEntity;
import dto.OrderDto;
import dto.ProductDto;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.Optional;

@Data
public class OrderVo implements DeepEntity<OrderDto> {

    /**
     * 商户名称
     */
    private String merchantName;


    /**
     * 商品列表
     */
    private List<ProductDto> productList;

    @Override
    public Optional<OrderDto> copy() {
        OrderDto orderDto = new OrderDto();
        BeanUtils.copyProperties(this,orderDto);
        orderDto.setProductList(this.getProductList());
        return Optional.of(orderDto);
    }
}
